<?php

class Home_index_Controller extends Base_Controller {
    /*
      |--------------------------------------------------------------------------
      | The Default Controller
      |--------------------------------------------------------------------------
      |
      | Instead of using RESTful routes and anonymous functions, you might wish
      | to use controllers to organize your application API. You'll love them.
      |
      | This controller responds to URIs beginning with "home", and it also
      | serves as the default controller for the application, meaning it
      | handles requests to the root of the application.
      |
      | You can respond to GET requests to "/home/profile" like so:
      |
      |		public function action_profile()
      |		{
      |			return "This is your profile!";
      |		}
      |
      | Any extra segments are passed to the method as parameters:
      |
      |		public function action_profile($id)
      |		{
      |			return "This is the profile for user {$id}.";
      |		}
      |
     */

    public function action_test() {
        /* $sessionID = 'ee1e82dd4f431b4b2e51ffd25a20916100fd4ae9';
          session_id($sessionID);
          session_start();
          echo $_SESSION['username']; */
        //echo Session::get('username');
        //$wd=Input::get('wd');
        //echo ($wd);exit;
        /*$str='[{"id":"5","title":"cpp","duration":"120","image":"\/upload\/MTM2NjUzOTk2Mw==.jpg","price":"4294967295","type":"0","viewed":"100","status":"1","ctime":"2013-03-17 23:33:22","sort_order":"0","category_id":"14","category_name":"\u5316\u5de5","desc_abstract":null},{"id":"7","title":"cpp","duration":"120","image":"\/upload\/MTM2NjU0MDAzOA==.jpg","price":"120000","type":"0","viewed":"100","status":"1","ctime":"2013-03-17 23:33:22","sort_order":"0","category_id":"15","category_name":"\u6211\u4eec","desc_abstract":null},{"id":"11","title":"cpp\u7f16\u7a0b","duration":"100","image":"\/upload\/MTM2NjU0MDA3MA==.jpg","price":"100000","type":"0","viewed":"0","status":"1","ctime":"2013-04-06 17:53:52","sort_order":"0","category_id":"15","category_name":"\u6211\u4eec","desc_abstract":"edwinxie\u7684\u7b2c\u4e00\u4e2a\u6559\u7a0b"},{"id":"12","title":"cpp\u7f16\u7a0b","duration":"100","image":"\/upload\/MTM2NjU0MDIwOA==.jpg","price":"100000","type":"0","viewed":"0","status":"1","ctime":"2013-04-06 17:54:21","sort_order":"0","category_id":"15","category_name":"\u6211\u4eec","desc_abstract":"edwinxie\u7684\u7b2c\u4e00\u4e2a\u6559\u7a0b"},{"id":"13","title":"cpp\u7f16\u7a0b","duration":"100","image":"\/upload\/MTM2NjU0MDc1Ng==.jpg","price":"10000","type":"0","viewed":"0","status":"1","ctime":"2013-04-06 18:25:31","sort_order":"0","category_id":"15","category_name":"\u6211\u4eec","desc_abstract":"edwinxie\u7684\u7b2c\u4e00\u4e2a\u6559\u7a0b"},{"id":"15","title":"cpp\u7f16\u7a0b","duration":"100","image":"\/upload\/MTM2NjU0Mjk4MA==.jpg","price":"1000000000","type":"0","viewed":"0","status":"1","ctime":"2013-04-06 18:43:03","sort_order":"0","category_id":"15","category_name":"\u6211\u4eec","desc_abstract":"edwinxie\u7684\u7b2c\u4e00\u4e2a\u6559\u7a0bedwinxie\u7684\u7b2c\u4e00\u4e2a\u6559\u7a0bed"},{"id":"16","title":"cpp\u7f16\u7a0b","duration":"100","image":"\/upload\/MTM2NjU0MjA1Mg==.jpg","price":"10000","type":"0","viewed":"0","status":"1","ctime":"2013-04-06 18:44:30","sort_order":"0","category_id":"15","category_name":"\u6211\u4eec","desc_abstract":"edwinxie\u7684\u7b2c\u4e00\u4e2a\u6559\u7a0b"}]';
        $arr=json_decode($str, true);
        $ret = Paginator::make($arr, count($arr), 4,false);
        echo json_encode($ret);exit;*/
        $cate = new VideoLogic();
        $ret = $cate->getTitleByID(5);
        echo json_encode($ret);
        //var_dump($ret);
        //$video=new FileUploadLogic(); 
        //$ret=$video->listItem(2);
        //var_dump($ret);
        //$re=json_encode($ret);
        //var_dump($ret);
        //var_dump(json_decode($re));
        // return 
        //$reviewModel=new ReviewLogic();
        //$str=  Input::get('id');
        //Session::put('password', '123');
        //$re=new CategoryLogic();
        /* $ret=$re->addCategory(9, '计算机');
          $re->addCategory(9, '电气信息');
          $re->addCategory(9, '化工');8?

         */
        // var_dump($ret=$re->listTopLevelCat());
        //$ret=$re->listCategoryTree();
        //$name = Session::get('name');
        //$pass = Session::get('password');
        //var_dump($ret); //Response::json($reviewModel->getReviewByVideoID(1, 10));
    }

}